package com.xungou.utils;

import java.security.MessageDigest;
import org.apache.shiro.crypto.SecureRandomNumberGenerator;
import org.apache.shiro.crypto.hash.Md5Hash;

public class SecurityUtil {

	private static SecureRandomNumberGenerator randomGener;
	static{

		randomGener = new SecureRandomNumberGenerator();
	}
	public static String encodeByMD5(String rowStr) {
		return new Md5Hash(rowStr).toHex();
	}
	
	public static String getRandomStr(){
		return randomGener.nextBytes().toHex();
	}
	
}